//
//  FountCell.m
//  BabyBedtimeStory
//
//  Created by qianfeng on 15-6-21.
//  Copyright (c) 2015年 张鹏毅. All rights reserved.
//

#import "FountCell.h"
#import "UIImageView+WebCache.h"
@implementation FountCell
{
    UIImageView *_data_listimageView;
    UILabel *_data_list_sub_titleLabel;
    UILabel *_data_list_titleLabel;
}
-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self creatViewWithFrame:frame];
    }
    return self;
}

-(void)creatViewWithFrame:(CGRect)frame{
    _data_listimageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
    [self.contentView addSubview:_data_listimageView];
    
    _data_list_titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height+5, frame.size.width, 50)];
    _data_list_titleLabel.numberOfLines = 0;
    _data_list_titleLabel.font = [UIFont fontWithName:@"Didot" size:13];
    [self.contentView addSubview:_data_list_titleLabel];
    
    _data_list_sub_titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height-20, frame.size.width, 20)];
    _data_list_sub_titleLabel.font = [UIFont fontWithName:@"Didot" size:11];
    _data_list_sub_titleLabel.textColor = [UIColor whiteColor];
    _data_list_sub_titleLabel.backgroundColor = [UIColor darkGrayColor];
    _data_list_sub_titleLabel.alpha = 0.6;
    [self.contentView addSubview:_data_list_sub_titleLabel];
}

-(void)showWithModel:(StoryModel *)model{
        [_data_listimageView sd_setImageWithURL:[NSURL URLWithString:model.image_url] placeholderImage:[UIImage imageNamed:@"yujiazai"]];
        _data_list_titleLabel.text = model.title;
        _data_list_sub_titleLabel.text = [NSString stringWithFormat:@" %@" ,model.sub_title];
}

@end
